import {
    createRouter,
    createWebHashHistory
} from 'vue-router'
import constants from './constansRouters';
import nprogress from 'nprogress'

const router = createRouter({
    history: createWebHashHistory(),
    routes: constants
});

router.beforeEach((to) => {
    if (to.meta && to.meta.title) document.title = to.meta.title
    nprogress.start();
})
router.afterEach(() => {
    nprogress.done();
})

export default router;